@extends('Layout.Index')
@section('css')
    <link href="{{asset('css/plugins/uploadify/uploadify.css')}}" rel="stylesheet">
@endsection
@section('content')
    <div class="wrapper wrapper-content  animated fadeInRight">
        <div class="row">
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>上传设置</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="panel panel-primary">
                            <div class="panel-heading alert-danger">使用须知:</div>
                            <div class="panel-body">
                                <ul>
                                    <li >依据服务器环境支持最大上传组件大小设置选项，如需要上传超大附件需调整服务器环境配置。</li>
                                </ul>
                                </p>
                            </div>
                        </div>
                        <form class="form-horizontal" role="form" name="wetsite_setting">
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">图片文件大小</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="" placeholder="当前服务器环境，最大允许上传64MB 的文件，您的设置请勿超过该值。">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">图片扩展名</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="" placeholder="图片扩展名，用于判断上传图片是否为后台允许，多个后缀名间请用半角逗号 "," 隔开。">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <button type="button" class="btn btn-primary">确认提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>默认图片</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="panel panel-primary">
                            <div class="panel-heading alert-danger">使用须知:</div>
                            <div class="panel-body">
                                <ul>
                                    <li >默认图片用于系统初始化时前台相关位置所显示的内容，商城及其他模块相关默认图片在其各自栏目设置项内进行操作。</li>
                                </ul>
                                </p>
                            </div>
                        </div>
                        <form class="form-horizontal" role="form" name="prevent_irrigation_setting" id="prevent_irrigation_setting">
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">默认会员头像</label>
                                <div class="col-sm-10">
                                    <input type="file" name="file_upload" id="file_upload" />
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <button type="button" class="btn btn-primary upload">确认提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('javascript')
    <script src="{{asset('js/plugins/uploadify/jquery.uploadify.min.js')}}"></script>
    <script>
        //上传插件
        $("#file_upload").uploadify({
            uploadLimit:1,
            buttonClass:'btn-primary',
            buttonText : '添加图片',
            formData: {'_token' : "{{csrf_token()}}"},
            auto     : false,
            swf      : "{{asset('/js/plugins/uploadify/uploadify.swf')}}",
            uploader : '/upload'
        });

        $('.upload').on('click',function () {
            $("#file_upload").uploadify('upload','*');
        });
    </script>
@endsection